This minor version has been deprecated
MuleSoft Accelerator for Salesforce B2C Commerce Cloud icon

MuleSoft Accelerator for Salesforce B2C Commerce Cloud

(1 review)

Use case 2 - Inventory

Overview

The following use case is covered:

  • Inventory (B2C Commerce Cloud ← SAP)

On a scheduled basis (which is configurable), this use case shows you how to build the inventory list and push it into B2C Commerce Cloud.

High-level architecture

sfc-b2c-com-inventory-api-led-architecture.png

Workflow

Here is how it works:

  1. A scheduled event (which is configurable) is triggered in the scheduling service that calls the inventory process API. See the Common Scheduler for more information.
  2. Through the SAP system API, the inventory process API queries the inventory list and checks if it was created or updated since the last run from SAP.
  3. For each of the returned inventory items, data is then sent into the production environment of Commerce Cloud.

Sequence diagram

sfc-b2c-com-inventory-seq-diagram.png

Systems involved:

  • ERP System: Contains information about inventory and specific plant locations. SAP is accessed via the ERP system API.
  • B2C Commerce Cloud: Mule publishes inventory information into Commerce Cloud in the store inventory list.

Setup instructions

SAP Configuration

Follow the Custom BAPI setup instructions.

Mule projects

Follow the readme instructions of the following Mule application projects to set up and deploy the projects into Anypoint Platform for this use case.

Configurable Properties in the YAML file

NameValue
jobs.**properties for the “Jobs” object store. This OS stores the timestamp watermark for each unique job e.g. “products”, “inventory”.
productproperties for the products job/schedule.
inventory.**properties for the inventory job/schedule.

Configurable Properties in the YAML file

NameValue
sap.ivmaxrowsnumber of rows returned from the SAP BAPI function execution.
sap.bapiHow inventory records are fetched from the specific BAPI function in SAP

Configurable Properties in the YAML file

NameValue
config.batchmode in which inventory requests are sent to Commerce Cloud. If set to “yes” then Mule sends inventory records in a batch and if set to “no” then Mule sends one inventory record per request into Commerce Cloud
aggregator.sizenumber of inventory records that Mule should send to Commerce Cloud in a single request. Commerce Cloud constrains this to a maximum of 50.
Sap-plantmap the sap plant Id’s from SAP to Inventory list configured in Commerce Cloud.
inv-listconfigure the reverse mapping of inventory list to SAP plant Id.

Execution:

  1. Perform goods movement in SAP.
  2. Create new Inventory Lists in Commerce Cloud.
  3. Map the sap-plant to inv-list inside “Inventory Process API” properties.
  4. Run “Common Scheduler” inventory job.
  5. Schedules-> Inventory_process -> Run Now
  6. Check that the Commerce Cloud Inventory lists created in step 2 are filled with the new material stock.

B2C Commerce Cloud Components & configurations:

SAP Components & Configurations

BAPI exposing the inventory information

Data elements

Element NameData TypeDescription
allocationDecimalThe allocation quantity and reset date.
atsDecimalThe quantity of items available to sell (ATS). This is calculated as the allocation plus the preorderBackorderAllocation minus the turnover.
creation_dateDateReturns the value of attribute 'creationDate'.
inventory_list_idStringThe user supplied ID of the inventory list.
product_idStringThe user supplied ID of the product.
product_nameStringThe name of the product.
stock_levelDecimalThe current stock level. This is calculated as the allocation minus the turnover.

Reviews

TypeCustom
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onOct 30, 2020
Asset overview

Asset versions for 1.3.x

Asset versions
StatusVersionActions
1.3.0